def my_sum(p):
    if p.next == None:
        return p.data
    return my_sum(p.next) + p.data